﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Go.Tools;
using Go.Model;
using Go;
using System.Drawing;
using System.Windows.Forms;
using tpGo;


namespace tpGo
{
    class Intersection
    {
        private Coordinate _coordinate;
        private Tablero aTablero;


        public Intersection(Coordinate aCoordinate, Tablero tablero)
        {
            _coordinate = aCoordinate;
            aTablero = tablero;
        }

        // DEFINICIONES DE OPERADORES
        public static bool operator ==(Intersection aIntersection, Intersection otherIntersection)
        {

            if ((Object)aIntersection == null && (Object)otherIntersection == null)
                return true;

            if ((Object)aIntersection == null || (Object)otherIntersection == null)
                return false;
            return (aIntersection.X== otherIntersection.X) && (aIntersection.Y == otherIntersection.Y);
        }

        public static bool operator !=(Intersection aIntersection, Intersection otherIntersection)
        {
            return !(aIntersection == otherIntersection);
            //         return (aPosition.X == otherPosition.X) && (aPosition.Y == otherPosition.Y);
        }

        private void draw()
        {
            Point pto= new Point();
            pto.X = _coordinate.x;
            pto.Y = _coordinate.y;

            aTablero.Draw(Tablero.IMAGEWHITESTONE, Tablero.FIGUREHEIGHT, Tablero.FIGUREHEIGHT, pto); 
        }

        //Propiedades 
        public int Y
        {
            get { return _coordinate.y; }
        }
        public int X
        {
            get { return _coordinate.x; }
        }

        public Coordinate Coordinate
        {
            get { return _coordinate; }
            set { _coordinate = value; }
        }

    }
}